package org.mil.gui;

import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;

import javax.swing.ProgressMonitor;

public class CollectProgressListener  implements PropertyChangeListener {
	static String message="信息收集进度";
	static String note= "正在初始化...";
	ProgressMonitor monitor;
	int progress;
	@Override
	public void propertyChange(PropertyChangeEvent event) {
		 if (monitor == null)
             return;
           if (monitor.isCanceled()) {
             System.out.println("Monitor canceled");
           } else {
             progress =(Integer) event.getNewValue();;
             monitor.setProgress(progress);
             monitor.setNote("Loaded " + progress + " files");
           }
		 
		
		
		//System.out.println("Change:progress="+progress);
	}

	public ProgressMonitor getMonitor() {
		return monitor;
	}

	public void setMonitor(ProgressMonitor monitor) {
		this.monitor = monitor;
	}
	
}
